export default {
  state: {
    baseInfo: {},
    curNode: {},
  },
  mutations: {
    setBaseInfo(state, baseInfo) {
      state.baseInfo = baseInfo
    },
    setCurNode(state, curNode) {
      state.curNode = curNode;
    },
    setCurNodeData(state, arg){
      const {pIndex, index, options, field, childField} = arg;
      if (childField){
        state.curNode.data.configTree[pIndex].children[index][field][childField] = options;
      }else {
        state.curNode.data.configTree[pIndex].children[index][field] = options;
      }
    },
  },
  actions: {
   /*  requireUserInfo({ commit }) {
      commit('setUserName', res.data.name)
    }, */
  }
}